<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./js/echarts.min.js"></script>
    <style>
        .box {
            width: 500px;
            height: 500px;
            border: 1px solid #000;
        }
    </style>
</head>

<body>
    <div class="box"></div>
</body>

</html>
<script>
    let dom = document.querySelector(".box")
    let mychart = echarts.init(dom)
    let option = {
        title: {
    text: '漏斗图'
  },
  tooltip: {
    trigger: 'item',
    formatter: '{a} <br/>{b} : {c}%'
  },
  

  legend: {
    // orient: 'vertical',
    // left: 'left',
    // data: ['Show', 'Click', 'Visit', 'Inquiry', 'Order']
  },
  series: [
    {
      name: 'Funnel',
      type: 'funnel',
      left: '10%',
      top: 60,
      bottom: 60,
      width: '80%',
      min: 0,
      max: 100,
      minSize: '0%',
      maxSize: '100%',
      sort: 'descending',
      gap: 2,
      label: {
        show: true,
        position: 'inside'
      },
      labelLine: {
        length: 10,
        lineStyle: {
          width: 1,
          type: 'solid'
        }
      },
      itemStyle: {
        borderColor: '#fff',
        borderWidth: 1
      },
      emphasis: {
        label: {
          fontSize: 20
        }
      },
      data: [
        { value: 75, name: '子航' },
        { value: 40, name: '小路' },
        { value: 20, name: '小弦' },
        { value: 80, name: '小凯' },
        { value: 100, name: '小年' }
      ],
      label: {
        position: 'right'
      },
    }
  ]
};
    mychart.setOption(option)

</script>